package com.myprocessing.gui.util;


import java.awt.geom.Ellipse2D;

import com.myprocessing.box.Box;
import com.myprocessing.gui.PGuiFrameApplet;

import processing.core.PFont;

public class ProcessingObjectWrapper extends Box{

	protected Color color;
	protected Color fill = new Color(100,100,100);
	protected static PFont font; 
	protected boolean active = true;

	public void activateColor(){
		pApplet.colorMode(PGuiFrameApplet.RGB, 255);
		pApplet.stroke(color.getRed(), color.getGreen(), color.getBlue());
	}
	
	public void setFill(){
		pApplet.fill(fill.getRed(), fill.getGreen(), fill.getBlue());
	}

	public Color getColor() {
		return color;
	}

	public void setColor(Color color) {
		this.color = color;
	}
	
	public void println(String str){
		pApplet.println(str);
	}
	
	public void writeText(String text, int x, int y, int size){
		if(font == null){
			font = pApplet.loadFont("AmericanTypewriter-24.vlw");
		}
		pApplet.fill(0, 0, 0);
		pApplet.textFont(font, size);
		pApplet.text(text, x, y);
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public void activate() {
		this.active = true;
	}
	
	public void deactivate() {
		this.active = false;
	}
	
	public void display(){
		activateColor();
	}
}
